<table class="table-form" style="width: 100%;color:#808080 ">
    <tr>
        <td width="80" align="right">会员名称</td>
        <td id="td_charge_name"><?= \yii\helpers\Html::encode($customer->name); ?></td>
    </tr>
    <tr>
        <td width="80" align="right">账户余额</td>
        <td id="td_charge_balance"><?= \yii\helpers\Html::encode($customer->account); ?></td>
    </tr>
    <tr>
        <td width="80" align="right">交款金额</td>
        <td id="post_deposit">300</td>
    </tr>
</table>
<?=$form?>
<table class="table-form" style="width: 100%;color:#808080 ">
    <tr>
        <td width="80" align="right">合计</td>
        <td id="customer-charge-count">0</td>

    </tr>
</table>
<span id="account" style="display: none"></span>

<?php
 $js =<<<JS
    $('input').focusout(function () {
            rg = /^(([1-9][\d]*)(\.[\d]{1,3})?)|(0\.[\d]{1,3})$/;
            var num = 0;
            $('input').each(function () {
                if (rg.test($(this).val())) {
                    ha = $(this).val();
                    num =accAdd(num,parseFloat(ha));
                }
            });
            $('#customer-charge-count').html('¥'+num);
            $('#account').html(num);
        });
     $(document).on('click','#dosubmit',function(e){
         e.preventDefault();
         var account = parseInt($('#account').html());
         var deposit = parseInt($('#post_deposit').html());
         if(account != deposit){
            alert('输入正确的保证金金额');
            return false;
         }else{
               $('#accountrecord-form').submit();
         }
   });

JS;



\Yii::$app->view->registerJs($js); ?>

